<?php

require_once 'init.php';
require_once cf\Config::path.'api/page.php';

$page = cf\api\page\get('ask');
$smarty->assign('pageText',cf\api\page\getText($page['id']));

$childPages = cf\api\page\getTree($page['id'], false, 1, $page['link']);
$questions = array();
foreach ($childPages as $pg) {
	$questions[] = array(
		'question' => $pg['']['short_txt'],
		'answer' => cf\api\page\getText($pg['']['id'])
	);
}
$smarty->assign('questions',$questions);

show(
   'ask', 
   $page['name'], 
   array(), 				//Pages::getPath($page->id())
   $page['title'], 
   $page['keywords'], 
   $page['descr']
);

?>